from appium.webdriver.common.appiumby import AppiumBy

from base.wecom_app import WeComApp
from utils.log_utils import logger


class MainPage(WeComApp):
    # 通讯录按钮
    _CONTACT_BTN = AppiumBy.XPATH, "//*[@text='通讯录']"
    _WORKSTAND_BTN = AppiumBy.XPATH, "//*[@text='工作台']"

    def goto_address_list_page(self):
        from page.address_list_page import AddressListPage
        # 点击通讯录按钮
        logger.info("点击【通讯录】按钮")
        self.find_and_click(*self._CONTACT_BTN)

        # 跳转通讯录页面
        return AddressListPage(self.driver)
